//
//  CZLoadingCell.swift
//  GZWeibo007
//
//  Created by danli on 15/12/25.
//  Copyright © 2015年 Apple. All rights reserved.
//

import UIKit

class CZLoadingCell: UITableViewCell {

    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        prepareUI()
//        self.backgroundColor = UIColor.redColor()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func prepareUI()
    {
       contentView.addSubview(loadingIcon)
        contentView.addSubview(loadingLabel)
        
        loadingIcon.ff_AlignInner(type: ff_AlignType.CenterLeft, referView:loadingLabel, size: nil, offset: CGPointMake(-20, 0))
        loadingLabel.ff_AlignHorizontal(type: ff_AlignType.CenterCenter, referView: contentView, size: nil, offset: CGPointMake(20, 0))
        loadingIcon.startAnimating()
    }
    
    // MARK:-懒加载
    lazy var loadingIcon:UIActivityIndicatorView = {
       let view = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.Gray)
        view.tintColor = UIColor.redColor()
        return view
    }()
    
    lazy var loadingLabel:UILabel = {
        let label = UILabel()
        label.textColor = UIColor.lightGrayColor()
        label.text = "正在努力加载中..."
        return label
    }()
}
